﻿//-----------------------------------------------------------------------
// <copyright>
// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
// </copyright>
//----------------------------------------------------------------------- 
using System;
using System.Linq;
using System.Windows;
using Fulcrum.ControlGenerator;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Fulcrum.UnitTests.ControlGenerator
{
    [TestClass]
    public class ControlXmlConfigurationTestDoubleTests
    {
        public ControlXmlConfigurationTestDoubleTests()
        {
            // nothing
        }

        const string StandardXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingNameXml = @"<blah namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyNameXml = @"<blah name='' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingNamespaceXml = @"<blah name='MyName' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyNamespaceXml = @"<blah name='MyName' namespace='' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingSummaryXml = @"<blah name='MyName' namespace='Fulcrum.Test' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptySummaryXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingRemarksXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyRemarksXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingLocationXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' 
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyLocationXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location=''
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingHasAutomationPeerXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyHasAutomationPeerXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingAutomationPeerNameXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyAutomationPeerNameXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingAutomationPeerArgumentsXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' 
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyAutomationPeerArgumentsXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments=''
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingLocalizationCategoryXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyLocalizationCategoryXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingLocalizationModifiabilityXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyLocalizationModifiabilityXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingLocalizationReadabilityXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' 
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyLocalizationReadabilityXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability=''
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingOverrideStyleMetadataXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyOverrideStyleMetadataXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingPropertyChangeEventXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' >
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string EmptyPropertyChangeEventXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent=''>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingUsingsXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingTemplatePartsXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingRoutedCommandsXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingCommandBindingsXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingRoutedEventsXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingDependencyPropertiesXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <AttachedDependencyProperty name='ZFirstName' /> <AttachedDependencyProperty name='ASecondName' />
                                    </blah>";
        const string MissingAttachedDependencyPropertiesXml = @"<blah name='MyName' namespace='Fulcrum.Test' summary='My summary.' remarks='My remarks.' location='alocation'
                                          hasAutomationPeer='true' automationPeerName='AnAutomationPeer' automationPeerArguments='one, two'
                                          localizationCategory='Menu' localizationModifiability='Inherit' localizationReadability='Inherit'
                                          overrideStyleMetadata='false' propertyChangeEvent='RoutedEvent'>
                                        <Using name='ZusingOne' /> <Using name='AusingTwo' />
                                        <TemplatePart name='ZFirstName' /> <TemplatePart name='ALastname' />
                                        <RoutedCommand name='ZFirstCommand' /> <RoutedCommand name='ASecondCommand' />
                                        <CommandBinding name='ZFirstCommandBinding' /> <CommandBinding name='ASecondCommandBinding' />
                                        <RoutedEvent name='ZFirstEvent' /> <RoutedEvent name='ASecondEvent' />
                                        <DependencyProperty name='ZFirstName' /> <DependencyProperty name='ASecondName' />
                                    </blah>";

        [TestMethod]
        public void TestAttachedDependencyProperties()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(2, config.AttachedDependencyProperties.Count);
            Assert.AreEqual("ZFirstName", config.AttachedDependencyProperties.ElementAt(0).Name);
            Assert.AreEqual("ASecondName", config.AttachedDependencyProperties.ElementAt(1).Name);
        }

        [TestMethod]
        public void TestAutomationPeerArguments()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual("one, two", config.AutomationPeerArguments);
        }

        [TestMethod]
        public void TestAutomationPeerName()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual("AnAutomationPeer", config.AutomationPeerName);
        }

        [TestMethod]
        public void TestDependencyProperties()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(2, config.DependencyProperties.Count);
            Assert.AreEqual("ZFirstName", config.DependencyProperties.ElementAt(0).Name);
            Assert.AreEqual("ASecondName", config.DependencyProperties.ElementAt(1).Name);
        }

        [TestMethod]
        public void TestHasAutomationPeer()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(true, config.HasAutomationPeer);
        }

        [TestMethod]
        public void TestLocalizationCategory()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(LocalizationCategory.Menu, config.LocalizationCategory);
        }

        [TestMethod]
        public void TestLocalizationModifiability()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(Modifiability.Inherit, config.LocalizationModifiability);
        }

        [TestMethod]
        public void TestLocalizationReadability()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(Readability.Inherit, config.LocalizationReadability);
        }

        [TestMethod]
        public void TestLocation()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual("alocation", config.Location);
        }

        [TestMethod]
        public void TestName()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual("MyName", config.Name);
        }

        [TestMethod]
        public void TestNamespace()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual("Fulcrum.Test", config.Namespace);
        }

        [TestMethod]
        public void TestOverrideStyleMetadata()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(false, config.OverrideStyleMetadata);
        }

        [TestMethod]
        public void TestPropertyChangedEventType()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(PropertyChangedEventType.RoutedEvent, config.PropertyChangedEventType);
        }

        [TestMethod]
        public void TestRemarks()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual("My remarks.", config.Remarks);
        }

        [TestMethod]
        public void TestRoutedCommandBindings()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(2, config.RoutedCommandBindings.Count);
            Assert.AreEqual("ZFirstCommandBinding", config.RoutedCommandBindings.ElementAt(0).Name);
            Assert.AreEqual("ASecondCommandBinding", config.RoutedCommandBindings.ElementAt(1).Name);
        }

        [TestMethod]
        public void TestRoutedCommands()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(2, config.RoutedCommands.Count);
            Assert.AreEqual("ZFirstCommand", config.RoutedCommands.ElementAt(0).Name);
            Assert.AreEqual("ASecondCommand", config.RoutedCommands.ElementAt(1).Name);
        }

        [TestMethod]
        public void TestRoutedEvents()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(2, config.RoutedEvents.Count);
            Assert.AreEqual("ZFirstEvent", config.RoutedEvents.ElementAt(0).Name);
            Assert.AreEqual("ASecondEvent", config.RoutedEvents.ElementAt(1).Name);
        }

        [TestMethod]
        public void TestSummary()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual("My summary.", config.Summary);
        }

        [TestMethod]
        public void TestTemplateParts()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(2, config.TemplateParts.Count);
            Assert.AreEqual("ZFirstName", config.TemplateParts.ElementAt(0).Name);
            Assert.AreEqual("ALastname", config.TemplateParts.ElementAt(1).Name);
        }

        [TestMethod]
        public void TestUsingNamespaces()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(StandardXml));

            Assert.AreEqual(2, config.UsingNamespaces.Count);
            Assert.AreEqual("AusingTwo", config.UsingNamespaces.ElementAt(0));
            Assert.AreEqual("ZusingOne", config.UsingNamespaces.ElementAt(1));
        }

        [TestMethod]
        public void TestReaderAdvancement()
        {
            var xmlReader = XmlTestHelp.CreateXmlReader(StandardXml);

            Assert.IsTrue(xmlReader.IsStartElement());

            var config = new ControlXmlConfigurationTestDouble(xmlReader);

            Assert.IsFalse(xmlReader.IsStartElement());
        }

        [TestMethod]
        public void TestMissingAttachedDependencyProperties()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingAttachedDependencyPropertiesXml));

            Assert.AreEqual(0, config.AttachedDependencyProperties.Count);
        }

        [TestMethod]
        public void TestMissingDependencyProperties()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingDependencyPropertiesXml));

            Assert.AreEqual(0, config.DependencyProperties.Count);
        }

        [TestMethod]
        public void TestMissingRoutedCommandBindings()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingCommandBindingsXml));

            Assert.AreEqual(0, config.RoutedCommandBindings.Count);
        }

        [TestMethod]
        public void TestMissingRoutedCommands()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingRoutedCommandsXml));

            Assert.AreEqual(0, config.RoutedCommands.Count);
        }

        [TestMethod]
        public void TestMissingRoutedEvents()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingRoutedEventsXml));

            Assert.AreEqual(0, config.RoutedEvents.Count);
        }

        [TestMethod]
        public void TestMissingTemplateParts()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingTemplatePartsXml));

            Assert.AreEqual(0, config.TemplateParts.Count);
        }

        [TestMethod]
        public void TestMissingUsingNamespaces()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingUsingsXml));

            Assert.AreEqual(0, config.UsingNamespaces.Count);
        }

        [TestMethod]
        public void TestMissingName()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingNameXml));

            Assert.AreEqual(null, config.Name);
        }

        [TestMethod]
        public void TestEmptyName()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyNameXml));

            Assert.AreEqual("", config.Name);
        }

        [TestMethod]
        public void TestMissingNamespace()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingNamespaceXml));

            Assert.AreEqual(null, config.Namespace);
        }

        [TestMethod]
        public void TestEmptyNamespace()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyNamespaceXml));

            Assert.AreEqual("", config.Namespace);
        }

        [TestMethod]
        public void TestMissingSummary()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingSummaryXml));

            Assert.AreEqual(null, config.Summary);
        }

        [TestMethod]
        public void TestEmptySummary()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptySummaryXml));

            Assert.AreEqual("", config.Summary);
        }

        [TestMethod]
        public void TestMissingRemarks()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingRemarksXml));

            Assert.AreEqual(null, config.Remarks);
        }

        [TestMethod]
        public void TestEmptyRemarks()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyRemarksXml));

            Assert.AreEqual("", config.Remarks);
        }

        [TestMethod]
        public void TestMissingLocation()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingLocationXml));

            Assert.AreEqual("", config.Location);
        }

        [TestMethod]
        public void TestEmptyLocation()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyLocationXml));

            Assert.AreEqual("", config.Location);
        }

        [TestMethod]
        public void TestMissingHasAutomationPeer()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingHasAutomationPeerXml));

            Assert.AreEqual(false, config.HasAutomationPeer);
        }

        [TestMethod]
        public void TestEmptyHasAutomationPeer()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyHasAutomationPeerXml));

            Assert.AreEqual(true, config.HasAutomationPeer);
        }

        [TestMethod]
        public void TestMissingAutomationPeerName()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingAutomationPeerNameXml));

            Assert.AreEqual("MyNameAutomationPeer", config.AutomationPeerName);
        }

        [TestMethod]
        public void TestEmptyAutomationPeerName()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyAutomationPeerNameXml));

            Assert.AreEqual("", config.AutomationPeerName);
        }

        [TestMethod]
        public void TestMissingAutomationPeerArguments()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingAutomationPeerArgumentsXml));

            Assert.AreEqual("", config.AutomationPeerArguments);
        }

        [TestMethod]
        public void TestEmptyAutomationPeerArguments()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyAutomationPeerArgumentsXml));

            Assert.AreEqual("", config.AutomationPeerArguments);
        }

        [TestMethod]
        public void TestMissingLocalizationCategory()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingLocalizationCategoryXml));

            Assert.AreEqual(LocalizationCategory.None, config.LocalizationCategory);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void TestEmptyLocalizationCategory()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyLocalizationCategoryXml));
        }

        [TestMethod]
        public void TestMissingLocalizationModifiability()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingLocalizationModifiabilityXml));

            Assert.AreEqual(Modifiability.Unmodifiable, config.LocalizationModifiability);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void TestEmptyLocalizationModifiability()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyLocalizationModifiabilityXml));
        }

        [TestMethod]
        public void TestMissingLocalizationReadability()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingLocalizationReadabilityXml));

            Assert.AreEqual(Readability.Unreadable, config.LocalizationReadability);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void TestEmptyLocalizationReadability()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyLocalizationReadabilityXml));
        }

        [TestMethod]
        public void TestMissingOverrideStyleMetadata()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingOverrideStyleMetadataXml));

            Assert.AreEqual(true, config.OverrideStyleMetadata);
        }

        [TestMethod]
        public void TestEmptyOverrideStyleMetadata()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyOverrideStyleMetadataXml));

            Assert.AreEqual(true, config.OverrideStyleMetadata);
        }

        [TestMethod]
        public void TestMissingPropertyChangeEvent()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(MissingPropertyChangeEventXml));

            Assert.AreEqual(PropertyChangedEventType.DotNetEvent, config.PropertyChangedEventType);
        }

        [TestMethod]
        [ExpectedException(typeof(ApplicationException))]
        public void TestEmptyPropertyChangeEvent()
        {
            var config = new ControlXmlConfigurationTestDouble(XmlTestHelp.CreateXmlReader(EmptyPropertyChangeEventXml));
        }
   }
}
